DXCDT-372: Traverse assets tree for preservable fields #740
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🔧 Changes
Part two of keyword preservation implementation by building off of #738. This PR introduces the ability to recursively traverse an arbitrary JSON structure and look for preservable properties. The recursion here is necessary because the assets tree is an amalgamation of all the different Auth0 resource types which contain their own arbitrary data structures which may differ on a tenant-by-tenant basis.
Notably, this utility of this function is limited because it only produces a list of the field values to preserve which may help us understand what to preserve but it doesn't provide any guidance on where or how to preserve. The concept of "addresses" will be added in a follow-up PR which will improve the usefulness of this function, but wasn't added to keep this PR simple.
📚 References
Related Issues:
#328
#688
🔬 Testing
Added a single unit test that tests a variety of scenarios.
📝 Checklist